package com.mediatek.factorymode;

import android.content.Intent;
import android.app.Activity;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;
//import dalvik.annotation.Signature;
import java.util.ArrayList;
import java.util.List;

public class Report extends Activity
{
  private TextView mDefault;
  private List mDefaultList;
  private TextView mFailed;
  private List mFailedList;
  private List mOkList;
  private SharedPreferences mSp;
  private TextView mSuccess;
  private ArrayList<String> reportList;

  protected void ShowInfo()
  {
    String str1 = " | ";
    String str2 = "\n";
    StringBuilder localStringBuilder = new StringBuilder().append(getString(R.string.report_ok)).append(str2);
    int j = this.mOkList.size();
    for (int i = 0; i < j; i++)
    {
      localStringBuilder.append((String)this.mOkList.get(i)).append(str1);
    }
    this.mSuccess.setText(localStringBuilder.toString());
    StringBuilder localStringBuilder3 = new StringBuilder().append(str2).append(getString(2131230883)).append(str2);
    int l = this.mFailedList.size();
    for (int k = 0; k < l; k++)
    {
      localStringBuilder3.append((String)this.mFailedList.get(k)).append(str1);
    }
    this.mFailed.setText(localStringBuilder3.toString());
    StringBuilder localStringBuilder5 = new StringBuilder().append(str2).append(getString(2131230884)).append(str2);
    int i2 = this.mDefaultList.size();
    for (int i1 = 0; i1 < i2; i1++)
    {
      localStringBuilder5.append((String)this.mDefaultList.get(i1)).append(str1);
    }
    this.mDefault.setText(localStringBuilder5.toString());
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(R.layout.report);
    reportList = new Utils().getListArray(Report.this.getResources());
    SharedPreferences localSharedPreferences1 = getSharedPreferences("FactoryMode", 0);
    this.mSp = localSharedPreferences1;
    TextView localTextView1 = (TextView)findViewById(R.id.report_success);
    this.mSuccess = localTextView1;
    TextView localTextView2 = (TextView)findViewById(R.id.report_failed);
    this.mFailed = localTextView2;
    TextView localTextView3 = (TextView)findViewById(R.id.report_default);
    this.mDefault = localTextView3;
    ArrayList localArrayList1 = new ArrayList();
    this.mOkList = localArrayList1;
    ArrayList localArrayList2 = new ArrayList();
    this.mFailedList = localArrayList2;
    ArrayList localArrayList3 = new ArrayList();
    this.mDefaultList = localArrayList3;
    
    for(int i = 0; i < reportList.size(); i++){
        String itemName = reportList.get(i);
        String result = this.mSp.getString(itemName, "null");
        if(itemName.equals(getString(R.string.version))){
          result = Utils.getInt(this, "Version") == 1?"success":"default";
        }

        if(result.equals("success"))
        {
            this.mOkList.add(itemName);
        }
        else if(result.equals("failed"))
        {
            this.mFailedList.add(itemName);
        }
        else
        {
            this.mDefaultList.add(itemName);
        }
    }
    ShowInfo();
   Utils.addShortcut(Report.this, getString(R.string.Report));
  }
}
